home *** CD-ROM | disk | FTP | other *** search
/ C/C++ Users Group Library 1996 July / C-C++ Users Group Library July 1996.iso / vol_200 / 228_01 / isamupd.c < prev    next >
Encoding:
C/C++ Source or Header  |  1987-07-29  |  1.1 KB  |  55 lines

  1. /*
  2. HEADER:         CUGXXX;
  3. TITLE:          Update control record (of ISAM system);
  4. DATE:           3-31-86;
  5. DESCRIPTION:    Part of ISAM Library;
  6. KEYWORDS:       ISAM;
  7. FILENAME:       ISAMUPD.C;
  8. WARNINGS:       None;
  9. AUTHORS:        John M. Dashner;
  10. COMPILER:       Lattice C;
  11. REFERENCES:     US-DISK 1310;
  12. ENDREF
  13. */
  14. /*
  15. **                 ISAMC - Written by John M. Dashner
  16. */
  17.  
  18. #include <stdio.h>
  19. #include <ctype.h>
  20.  
  21. #include <isam.h>
  22.  
  23. /*
  24. **                  UPDATE - Control Record Update
  25. */
  26.  
  27. isamupd(hdr)
  28. struct isam *hdr;
  29. {
  30.     char buf[MAXKEY + 2];
  31.     struct rec1 *r1;
  32.     struct rec2 *r2;
  33.     r1 = (struct rec1 *) buf;
  34.     r2 = (struct rec2 *) buf;
  35.  
  36.     lseek(hdr->q7, 0L, 0);
  37.     r1->ttl_recs = hdr->q1;
  38.     r1->del_recs = hdr->q2;
  39.     if (write(hdr->q7, buf, hdr->q6 + 2))
  40.     {
  41.         isam_err = 8;
  42.         return ERROR;
  43.     }
  44.     r2->srt_recs = hdr->q3;
  45.     r2->del_ptr  = 0;       /* not presently used */
  46.     if (write(hdr->q7, buf, hdr->q6 + 2))
  47.     {
  48.         isam_err = 8;
  49.         return ERROR;
  50.     }
  51.     return NULL;
  52. }
  53.  
  54.  
  55.